/**
 * 管理者-普通经理
 * @author liaosh
 * @date 2022-10-15 22:29
 */
public class CommonManager extends Manager {

    public CommonManager(String name) {
        this.name = name;
    }

    @Override
    public void handleRequest(Request request) {
        if (request.getRequestType() != null
                && request.getRequestType() == 1
                && request.getNumber() < 3) {
            // 可处理 3 天以内的请假
            System.out.println("类型：" + request.getRequestTypeStr() + "，申请内容："
                    + request.getRequestContent() + "，数量：" + request.getNumber()
                    + " " + name + "审批通过");
        } else {
            // 其余申请转到上级
            if (superior != null) {
                superior.handleRequest(request);
            }
        }
    }
}
